A domain delineates the boundaries between a group of objects and their environment. The objects contained in a document are an example of such a group: the document and its components belong to one domain. When an object of a domain has been modified, the other objects of the same domain may be notified by broadcasting a message to them.
Apart from reducing message traffic, domains may have other purposes as well: if the objects in a domain are persistent (-> Stores), the domain defines which objects are stored in a particular file and which are not.
For documents, a domain is also the scope for undo/redo operations: every document domain manages its own undo/redo stacks for operations.
TYPE Message
Interface
This is the base type of messages to be broadcast in one (or sometimes in several) domains.
Messages are used internally.
Messages are extended internally.
TYPE Domain
Interface
Domains define boundaries around objects, they define which objects are "inside" and which are "outside" from their point of view.
Domains are used in Stores (-> Stores) to define groups of persistent objects. Each document belongs to at most one domain, notification messages are usually broadcast throughout one domain, and undo/redo is performed on a per-domain basis.
PROCEDURE (d: Domain) Handle (VAR msg: Message)
Empty
Message handler for a domain.
Handle is called internally.
Handle is extended internally.
TYPE OpName
String type for the name of an operation.
TYPE Operation
Operations are objects which perform modifications on other objects. All objects modified by the operation must belong to the same domain. The operation's Do procedure performs the desired modification, and must be involutory, i.e. when called twice, its effect must have been neutralized again.
inUse-: BOOLEAN
Tells whether the operation is alreay in use by a domain.
name-: OpName
The operation's name.
PROCEDURE (op: Operation) Do
Interface
This procedure performs a modification on other objects. It must be involutory, i.e. it must have the identical effect if called an odd number of times, and no effect if called an even number of times.
Do is called internally.
Do must be extended by every concrete operation; many model (-> Models) and view (-> Views) modifications are implemented as operations.